const koa = require('koa');
const app = new koa();

const bodyParser = require('koa-bodyparser');
const userRouter = require("../router/user.router")
const authoRouter = require("../router/auth.router")
const errorHandler = require("./error-handle")
const useRoutes = require("../router")

app.use(bodyParser())
useRoutes(app) //动态注册路由

app.on('error',errorHandler)


module.exports = app;